#!/bin/bash

sudo apt-get install -y gcc g++ git cmake ninja-build
git clone https://github.com/llvm/llvm-project.git

# CMAKE_BUILD_TYPE=DEBUG
cd llvm-project
git checkout -b llvmorg-12.0.1 llvmorg-12.0.1
mkdir build
cd build

cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="clang" \
	-DCMAKE_INSTALL_PREFIX=/home/zzy/disk2/bin ../llvm

ninja # -j2
# ninja check-all
ninja install
